<form class="form-horizontal" method="post">
	<input type="hidden" name="action" value="modify_member" />
	<input type="hidden" name="idx" value="<?php echo $result['idx']?>" />
	<input type="hidden" name="options" value="<?php echo @$options ?>" />
	
	<div class="control-group">
		<label class="control-label" for="id">아이디</label>
		<div class="controls">
			<input type="text" name="id" id="id" value="<?php echo $result['id']?>" required placeholder="아이디" autofocus class="span2" />
		</div>
	</div>
	<div class="control-group">
		<label class="control-label" for="email">이메일</label>
		<div class="controls">
			<input type="text" name="email" id="email" value="<?php echo $result['email']?>" required placeholder="이메일" class="span2" />
		</div>
	</div>
	<div class="control-group">
		<label class="control-label" for="nick">이름</label>
		<div class="controls"><input type="text" name="nick" id="nick" value="<?php echo $result['nick']?>" required placeholder="이름" class="span2" /></div>
	</div>
	<div class="control-group">
		<label class="control-label" for="password">비밀번호</label>
		<div class="controls"><input type="password" name="password" id="password" placeholder="비밀번호" class="span2" /></div>
	</div>

<?php if ($use_jumin) : ?>
	<div class="control-group">
		<label class="control-label" for="birth">주민번호</label>
		<div class="controls">
			<input type="text" name="birth" id="birth" required style="width:60px;" value="<?php echo @$result['birth']?>" readonly /> -
			<input type="password" name="jumin2" style="width:70px;" value="1111111" readonly /></div>
	</div>
<?php endif; ?>
<?php if ($use_phone) : ?>
	<div class="control-group">
		<label class="control-label" for="phone0">연락처</label>
		<div class="controls">
			<?php $phone = explode("-", $result['phone']); ?>
			<input type="text" name="phone0" id="phone0" required style="width:30px;" value="<?php echo @$phone[0]?>" /> -
			<input type="text" name="phone1" required style="width:40px;" value="<?php echo @$phone[1]?>" /> -
			<input type="text" name="phone2" required style="width:40px;" value="<?php echo @$phone[2]?>" />
		</div>
	</div>
<?php endif; ?>


	<div class="control-group">
		<label class="control-label">그룹</label>
		<div class="controls">
<?php foreach($grouplist as $k => $v): ?>
			<label class="checkbox inline"><input name="groups[]" value="<?php echo $v['idx']?>" type="checkbox"<?php echo (in_array($v['idx'], $result['groups']))?" checked":"" ?> /> <?php echo $v['name']?></label>
<?php endforeach;?>
		</div>
	</div>
<?php 
if ( is_array($result['options']) ) :
foreach($result['options'] as $k => $v):
?>
	
	<div class="control-group">
		<label class="control-label" for="<?php echo $k?>"><?php echo $k?></label>
		<div class="controls"><input type="text" name="<?php echo $k?>" id="<?php echo $k?>" value="<?php echo $v?>" class="span2" /></div>
	</div>

<?php endforeach;endif; ?>

	<div class="control-group">
		<label class="control-label" for="contents">회원설명</label>
		<div class="controls"><textarea name="contents" id="contents" class="span6" style="height:120px;"><?php echo htmlspecialchars($result['contents'])?></textarea></div>
	</div>
	<div class="control-group">
		<div class="controls">
			<button type="submit" name="submit" id="submit" class="btn btn-warning">수정</button>
			<a data-toggle="modal" href="#myDelete" class="btn">삭제</a>
		</div>
	</div>
</form>

<form class="form-horizontal" method="post">
	<input type="hidden" name="action" value="delete_member" />
	<input type="hidden" name="idx" value="<?php echo $result['idx']?>" />

	<div id="myDelete" class="modal hide fade">
		<div class="modal-header">
			<button type="button" data-dismiss="modal" class="close">&times;</button>
			<h4>정말로 삭제합니까?</h4>
		</div>
		<div class="modal-body"><p>한번 삭제하면 다시는 돌이킬 수 없습니다.</p></div>
		<div class="modal-footer">
			<a href="#" data-dismiss="modal" class="btn">닫기</a>
			<button type="submit" class="btn btn-warning">삭제</button>
		</div>
	</div>
</form>	